package com.fit.entities;

import java.util.LinkedList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.apache.tapestry5.beaneditor.NonVisual;
import org.apache.tapestry5.beaneditor.Validate;

import com.fit.entities.manytomany.ProjSciField;
import com.fit.entities.manytomany.UserSciField;

@Entity
@Table(name = "Scientific_Field")
public class ScientificField {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@NonVisual
	@Column(name = "id")
	private long id;
	@Column(name = "name", nullable = false)
	@Validate("required")
	private String name;
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "pk.scientificField")
	private List<UserSciField> userSciField = new LinkedList<UserSciField>();
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "pk.scientificField")
	private List<ProjSciField> projSciField = new LinkedList<ProjSciField>();
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public List<UserSciField> getUserSciField() {
		return userSciField;
	}
	public void setUserSciField(List<UserSciField> userSciField) {
		this.userSciField = userSciField;
	}
	public List<ProjSciField> getProjSciField() {
		return projSciField;
	}
	public void setProjSciField(List<ProjSciField> projSciField) {
		this.projSciField = projSciField;
	}
	
	

}
